import Vue from 'vue'
import App from './App'
import Utils from "./utils/util"
import Req from './common/api.js'
import ReqTwo from './common/javaApi.js'
import javaApiTwo from './common/javaApiTwo.js'
import javaApiTag from './common/javaApiTag.js'
import javaApiErp from './common/javaApiErp.js'
import new_file from './common/new_file.js'
import NoteApi from './common/javanoteapi.js'
import javaCircle from './common/javaCircle.js'
import request from "./common/request";
import {activeReport} from './common/dadian.js'
import directive from './directives/index.js'

Vue.prototype.$api = Req;
Vue.prototype.$javaApi = ReqTwo;
Vue.prototype.$javaApiTag = javaApiTag;
Vue.prototype.$javaJifenApi = javaApiTag;
Vue.prototype.$javaApiTwo = javaApiTwo;
Vue.prototype.$javaApiErp = javaApiErp;
Vue.prototype.$new_file = new_file;
Vue.prototype.$NoteApi = NoteApi;
Vue.prototype.$javaCircle = javaCircle;
Vue.prototype.$request = request;
Vue.prototype.$dadian = activeReport;
Vue.config.productionTip = false;
App.mpType = 'app';
Vue.prototype.$productType = "100039"
//加载工具
Vue.prototype.api_host = "http://127.0.0.1:8000";
Vue.prototype.chat_host = "http://127.0.0.1:8282";
Vue.prototype.image_host = "https://wechat-pictures-1301970825.file.myqcloud.com/wxapp/";
Vue.prototype.utils = Utils;

//定义一些常用变量
const systemInfo = uni.getSystemInfoSync();
Vue.prototype.platform = systemInfo.platform;//手机平台
Vue.prototype.phoneBrand = systemInfo.brand;//手机品牌
Vue.prototype.phoneModel = systemInfo.model;//手机型号

Vue.prototype.barHeight = systemInfo.statusBarHeight;//状态栏高度
Vue.prototype.screenWidth = systemInfo.screenWidth;//屏幕总宽度
Vue.prototype.screenHeight = systemInfo.screenHeight;//屏幕总高度
Vue.prototype.windowWidth = systemInfo.windowWidth;//窗口可视宽度
Vue.prototype.windowHeight = systemInfo.windowHeight;//窗口可视高度
Vue.prototype.version = "1.0";

// 定义eventBus
Vue.prototype.$eventBus = new Vue();

//图拍地址
Vue.prototype.$imageUrl=()=>{
	return "https://wechat-pictures-1301970825.file.myqcloud.com/wxapp";
}
// 定义是否是从点点乐进入视频
Vue.prototype.$fromDd = {type: 0};
//更新相关
//#ifdef APP-PLUS
const version = plus.runtime.version;
Vue.prototype.version = version;
//#endif

Vue.use(directive)

const app = new Vue({...App});
app.$mount();
Vue.prototype.$navigateTo = function (url) {
    uni.navigateTo({
        url: url
    })
}

Vue.prototype.$navigateBack = function () {
    uni.navigateBack()
}
Vue.prototype.$toNum = function (num) {
    if(num>=10000 && num<1000000){
        return (num/10000).toFixed(1)+'万'
    }else if(num>1000000){
        return '100+万'
    }
    return num
}
